package yiminsu.com.cn.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import yiminsu.com.cn.service.HotelstoryDictionariesService;
import yiminsu.com.cn.utils.ResultsUtil;

@RestController
@RequestMapping("/api/v1/hotelDictionaries")
public class HotelDictionariesController {
		
		private static ResultsUtil resultsUtil = new ResultsUtil();
		
		@Autowired
		private HotelstoryDictionariesService hotelstoryDictionariesService;
		
		/**
		 * 
		 * @return 查询房间字典
		 */
		@RequestMapping(value="/getDictionaries", method=RequestMethod.GET)
		@ResponseBody
		public ResultsUtil getHotelDictionaries(){
			
			System.out.println(System.getProperty("user.dir"));
			
			Map<String, List<?>> map = new HashMap<String,List<?>>();
			//获取房间设施
			map.put("facility", hotelstoryDictionariesService.getHotelFacility());
			//获取床的型号
			map.put("bedType", hotelstoryDictionariesService.getBedTypes());
			//获取房间价格名称
			map.put("money", hotelstoryDictionariesService.getHotelMoney());
			resultsUtil.setData(map);
			resultsUtil.setMsg("查询成功！");
			resultsUtil.setType(true);
			return resultsUtil;
	}
}
